﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%
		String value="";
		Cookie[] cookies = request.getCookies(); 
		if(cookies!=null){
		    for(Cookie cookie : cookies){   
	      	if ("userCookie".equals(cookie.getName())){   
	           value = cookie.getValue();   
	          }
     }
     }
 %>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>OA协同办公系统</title>
		<style type="text/css">
			.input-button{background-color: #005eac;border-color: #b8d4e8 #124680 #124680 #b8d4e8;border-style: solid;border-width: 1px;color: #fff;font-size: 12px;text-align: center;font-weight: bold;width: 85px;height: 30px;padding:8px;}
		</style>
		<link href="css/common.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
		<script type="text/javascript">
	function loginUser(){
		
		var name=$("#name").val();
		var password=$("#password").val();
		if(name==''||name=='null'){
			$("#errorInfo").html("请输入用户名！");
			return;
		}else{
			$("#errorInfo").html("");
		}
		if(password==''||password=='null'){
			$("#errorInfo").html("请输入密码！");
			return;
		}else{
			$("#errorInfo").html("");
		}
		
		document.loginForm.submit();
	}
	
document.onkeydown=function(event){
    var event = event ? event : window.event;
        if(event.keyCode==13){  
           loginUser();
        }
 }
	 
</script>
	</head>
	<body style="background: #76A5DB;">
			<table width="500" border="0" align="center" cellpadding="0"
				cellspacing="0">
				<tr>
					<td height="120">
						&nbsp;
					</td>
				</tr>
			</table>
			<table width="558" border="0" align="center" cellpadding="0" cellspacing="0">
				<tr>
					<td height="288" valign="top" background="image/lbg.png">
						<table width="500" border="0" align="center" cellpadding="0"
							cellspacing="0">
							<tr>
								<td height="100">
									&nbsp;
								</td>
							</tr>
						</table>
						
						<form action="login.action" name="loginForm" method="post">
						<table width="500" border="0" align="center" cellpadding="0"
							cellspacing="0">
							<tr><td colspan="2">&nbsp;<span id="errorInfo" style="color: #F00">${errors.errorInfo[0]}</span></td></tr>
							<tr>
								<td width="150" height="40" align="right">
									<span style="font-weight: bold; color: #333333;">用户名：</span>
								</td>
								<td width="330" align="left">
									<input id="name" name="name" type="text" style="width: 200px; height: 23px; border: 1px solid #8CC5E3;" value="<%=value %>"/>
								</td>
							</tr>
							<tr>
								<td height="40" align="right">
									<span style="font-weight: bold; color: #333333;">密&nbsp;&nbsp;&nbsp;&nbsp;码：</span>
								</td>
								<td align="left">
									<input id="password" name="password" type="password" style="width: 200px; height: 23px; border: 1px solid #8CC5E3;" />
								</td>
							</tr>
							<tr>
								<td height="40" align="center" colspan="2">
									&nbsp;&nbsp;&nbsp;&nbsp;<input  onclick="window.location='https://10.128.131.92:7002/oa/redirect.jsp'" value="证书登录" type="button"  class="input-button"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									<input onclick="loginUser()" type="button"   class="input-button" value="普通登录"/>
								</td>
							</tr>
						</table>
						</form>
					</td>
				</tr>
			</table>
			<div style="display: none;">
			<iframe src="http://10.128.131.92/upload/api/uc.php?action=synlogout"></iframe>
			</div>
	</body>
</html>
